//
//  MatchModel.swift
//  dataBaseProj
//
//  Created by sea on 2020/1/7.
//  Copyright © 2020 CDSCRB. All rights reserved.
//

import UIKit
@objcMembers

class MatchModel: NSObject {
    var matchId:String?
    /// 比赛时间
    var matchTime:String?
    /// 队伍a分数
    var matchScoreA:String?
    
    /// 队伍b分数
    var matchScoreB:String?
    
    /// 队伍a id
    var matchTeamA:String?
    
    /// 队伍b id
    var matchTeamB:String?
    
    /// 比赛名字
    var matchName:String?
    

    var matchStatus:String?
    
  
    
   class func getAllMatch()->[MatchModel]{
    var modelArr = [MatchModel]()
    DHDataBaseManager.shareDataBaseManager.searchWithSql(sql: "select * from \(matchTableName)") { (result) in
        if result is FMResultSet {
            let rs = result as! FMResultSet
            while (rs.next()) {
                let model = MatchModel()
                model.matchId = rs.string(forColumn: DHMatchId)
                model.matchName = rs.string(forColumn: DHMatchName)
                model.matchTime = rs.string(forColumn: DHMatchTime)
                model.matchTeamA = rs.string(forColumn: DHMatchTeamA)
                model.matchTeamB = rs.string(forColumn: DHMatchTeamB)
                model.matchScoreA = rs.string(forColumn: DHMatchScoreA)
                model.matchScoreB = rs.string(forColumn: DHMatchScoreB)
                model.matchStatus = rs.string(forColumn: DHMatchStatus)
                modelArr.append(model)
            }
            }
        }
    return modelArr
    }
    

}
